#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
#include <ctype.h>

#define SET_BIT(a, i)	((a) |= (1 << (i)))
#define UNSET_BIT(a, i)	((a) &= ~(1 << (i)))
#define GET_BIT(a, i)	(((a) >> (i)) & 1)

int
main(int argc, char **argv)
{
	int in = 0, out = 0, prev = 2, pos = 7;

	while (scanf("%d", &in) == 1) {
		if (prev == 2) {
			prev = GET_BIT(in, pos);
			--pos;
		} else {
			pos = 7;
		}

		while (pos >= 0) {
			if (GET_BIT(in, pos) == prev && out < 127) {
				++out;
				--pos;
			} else {
				if (prev)
					SET_BIT(out, 7);
				else
					UNSET_BIT(out, 7);
				printf("%d ", out);
				prev = GET_BIT(in, pos);
				out = 0;
				--pos;
			}
		}
	}

	if (GET_BIT(in, pos + 1) == prev && out == 0 || out != 0) {
		if (prev)
			SET_BIT(out, 7);
		else
			UNSET_BIT(out, 7);
		printf("%d\n", out);
	} else
		fputc('\n', stdout);

	return 0;
}
